package com.bifrost.task;

import com.bifrost.service.ProductReviewService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.log.XxlJobLogger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author rangf
 * @date 2018/3/9
 */
@Component
@JobHandler(value="autoReviewTask")
public class AutoReviewTask extends IJobHandler{

    private Logger logger = LoggerFactory.getLogger(AutoReviewTask.class);

    @Autowired
    ProductReviewService productReviewService;

    public void execute(){

    }

    @Override
    public ReturnT<String> execute(String s) throws Exception {
        XxlJobLogger.log("执行自动评价开始...");
        productReviewService.autoReview();
        XxlJobLogger.log("执行自动评价完成...");
        return ReturnT.SUCCESS;
    }
}
